<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/dmodule">
		<html>
			<head>
			<meta charset="utf-8" />
			<meta name="viewport" content="width=device-width, initial-scale=1" />
			<title>IETM浏览器</title>
			<link rel="stylesheet" href="/css/important_css.css"  type="text/css" />
			<link type="text/css" href="/css/dm/s1000D.css" rel="stylesheet" />
			<script type="text/javascript" src="/js/jquery.js"></script>
			<script type="text/javascript" src="/js/jquery-ui.js"></script>
			<script type="text/javascript" src="/js/UnityObject2.js"></script>
			<script type="text/javascript" src="/js/procedure_api.js"></script>
			<script type="text/javascript" src="/js/media.js"></script>
			<script type="text/javascript" src="/js/dialog-help.js"></script>
			<script type="text/javascript" src="/ietm/js/public.js"/>
			<script type="text/javascript" src="/js/jquery.form.js"></script>
			<script type="text/javascript" src="/js/zebra_dialog.src.js"></script>
			<script type="text/javascript" src="/js/Tdrag.js"></script>
			<script type="text/javascript" src="/js/menu.js" charset="UTF-8"></script>
			<script type="text/javascript" src="/js/note.js"></script>
			<script type="text/javascript" src="/js/pprompt.js"></script>
			<script type="text/javascript" src="/ietm/js/dm-plugin.js"></script>
			<style type="text/css">
	    	body,html{background:#fff;width:100%;height:100%;overflow:auto}
			</style>
			</head>
			<body>
			<div class="home-d">
			<div class="home-d-t active">
				<div class="home-d-t-pub">
				  <div class="home-d-t-title"><span>数据模块信息</span></div>
				</div>
				<div class="home-d-t-content">
					<table width="50%" align="left" cellpadding="4" cellspacing="0">
					<tr>
						<td width="100%" colspan="2" style="font-weight:bold;">标识信息</td>
					</tr>
					<!--xml解析内容-->
					<tr>
						<td>数据模块编码:</td>
						<td>
						<xsl:for-each select="identAndStatusSection/dmAddress/dmIdent">
								<xsl:apply-templates select="dmCode" mode="dmCode"/>
						</xsl:for-each>
						</td>
					</tr>
					<tr>
						<td>版本信息:</td>
						<xsl:for-each select="identAndStatusSection/dmAddress/dmIdent">
								<xsl:apply-templates select="issueInfo" mode="issueInfo"/>
						</xsl:for-each>
					</tr>
					<tr>
						<td>发布日期:[yyyy-mm-dd]</td>
						<xsl:for-each select="identAndStatusSection/dmAddress/dmAddressItems">
								<xsl:apply-templates select="issueDate" mode="issueDate"/>
						</xsl:for-each>
					</tr>
					<tr>
					   <td>语言:[国家/语言]</td>
					  <xsl:for-each select="identAndStatusSection/dmAddress/dmIdent">
								<xsl:apply-templates select="language" mode="language"/>
						</xsl:for-each>
					</tr>
				</table>
				<table width="50%" align="right" cellpadding="0" cellspacing="0">
					<tr>
						<td width="100%" colspan="2" style="font-weight:bold;">状态信息</td>
					</tr>
					<!--xml解析内容-->
					<tr>
						<td>密级:</td>
						<xsl:for-each select="identAndStatusSection/dmStatus">
							<xsl:apply-templates select="security" mode="security"/>
						</xsl:for-each>
					</tr>
					<tr>
						<td>责任合作单位:</td>
						<xsl:for-each select="identAndStatusSection/dmStatus">
							<xsl:apply-templates select="responsiblePartnerCompany" mode="responsiblePartnerCompany"/>
						</xsl:for-each>
					</tr>
					<tr>
						<td>创作单位:</td>
						<xsl:for-each select="identAndStatusSection/dmStatus">
							<xsl:apply-templates select="originator" mode="originator"/>
						</xsl:for-each>
					</tr>
					<tr>
						<td>适用性信息:</td>
						<td><xsl:value-of select="identAndStatusSection/dmStatus/applic/displayText/simplePara"/></td>
						</tr>
					<tr>
						<td>质量验证:</td>
						<td>理论验证(TT)</td>
					</tr>
				</table>
				</div>
			</div>
			<div class="home-d-b">
				<!--左右的样式-->
				<div class="home-d-b-tow">
					<div>
						<div class="home-d-t-pub">
							<div class="home-d-t-title">
							<!--解析内容标题-->
								<span class="dmtitle">
									<xsl:for-each select="identAndStatusSection/dmAddress/dmAddressItems">
										<xsl:apply-templates select="dmTitle" mode="dmTitle"/>
									</xsl:for-each>
								</span>
							</div>
							<div class="home-d-t-syx">
							<span>适用性：
								<xsl:value-of select="identAndStatusSection/dmStatus/applic/displayText/simplePara"/>
							</span>
							<span>密级：
							<xsl:for-each select="identAndStatusSection/dmStatus">
							<xsl:apply-templates select="security" mode="security1"/>
							</xsl:for-each>
							</span>
							<span class="home-d-m-show">更多>></span>
							<span class="home-d-m-hide">隐藏>></span>
							</div>
						</div>
						<div class="home-d-b-content" id="article">
						<!--解析主题内容-->
						<xsl:apply-templates select="content"/>
						</div>
					</div>
					<div class="home-d-b-towr" style="display:none">
						<div class="home-d-t-pub">
						  <div class="home-d-t-title"><span>多媒体显示区</span></div>
						  <div class="home-d-t-syx"><div class="cgmu3dclose"></div></div>
						  <div class="home-d-t-syx" style="margin-right:30px;"><div class="fullscreen"></div></div>
						</div>
						<div class="home-d-b-content" id="ietm-media">
						
						</div>
					</div>
				</div>
			</div>
		</div>	
			</body>
		</html>
	</xsl:template>
	
<!--主体结束，模板开始-->

<!--图表解析-->
<xsl:template match="figure">
	<div class="figIndent">
	<!-- <a><xsl:value-of select="graphic/@infoEntityIdent"/></a> -->
	</div>
	<div class="thumbnail">
	<a>
		<xsl:element name="image">
			<xsl:attribute name="alt">Thumbnail</xsl:attribute>
			<xsl:attribute name="class">thumbnail</xsl:attribute>
            <xsl:attribute name="id">%PICID%</xsl:attribute>
			<xsl:attribute name="height">100</xsl:attribute>
			<xsl:attribute name="src">%PATH%/<xsl:value-of select="graphic/@infoEntityIdent"/>.%ext%</xsl:attribute>
		</xsl:element>
	</a>

	<!--cgm支持部分-->
    <xsl:if test="graphic/hotspot">
    <div style="display:none;">
      <table cellspacing="0" class="bordered cgm_hotspot_list">
        <thead>
          <tr>
            <th class="bordered">
              <p class="legend">部件号</p>
            </th>
            <th class="bordered">
               <p class="legend">描述</p>
            </th>
          </tr>
        </thead>
      <tbody>
      	<xsl:for-each select="graphic/hotspot">
        <tr>
          <td class="bordered">
            <p class="legend cgm_hotspot_element"><xsl:value-of select="@applicationStructureName"/></p>
          </td>
          <td class="bordered">
            <p class="legend"><xsl:value-of select="@objectDescr"/></p>
          </td>
        </tr>
        </xsl:for-each>
      </tbody>
     </table>
    </div>
   </xsl:if>

   
	<div class="textcenter">图片%PICNO% <xsl:value-of select="title"/></div>
	</div>
	<div style="clear:both"></div>
</xsl:template>

<!--解析标题-->
<xsl:template match="dmTitle">
		<xsl:value-of select="techName"/> - <xsl:value-of select="infoName"/>
</xsl:template>

<!--解析资料编号-->
<xsl:template match="*" mode="dmCode">
	<xsl:value-of select="@modelIdentCode"/>-<xsl:value-of select="@systemDiffCode"/>-<xsl:value-of select="@systemCode"/>-<xsl:value-of select="@subSystemCode"/>
	<xsl:value-of select="@subSubSystemCode"/>-<xsl:value-of select="@assyCode"/>-<xsl:value-of select="@disassyCode"/>
	<xsl:value-of select="@disassyCodeVariant"/>-<xsl:value-of select="@infoCode"/>
	<xsl:value-of select="@infoCodeVariant"/>-<xsl:value-of select="@itemLocationCode"/>
</xsl:template>
<!--版本信息-->
<xsl:template match="*" mode="issueInfo">
	<td>
	[版本号:<xsl:value-of select="@issueNumber"/>]
	<span  style="display:none"><xsl:value-of select="@inWork"/></span>
	</td>
</xsl:template>
<!--发布日期-->
<xsl:template match="*" mode="issueDate">
<td>
	<xsl:value-of select="@year"/>-<xsl:value-of select="@month"/>-<xsl:value-of select="@day"/>
</td>
</xsl:template>
<!--语言-->
<xsl:template match="*" mode="language">
<td>
	<xsl:value-of select="@countryIsoCode"/>/<xsl:value-of select="@languageIsoCode"/>
</td>
</xsl:template>
<!--秘级-->
<xsl:template match="*" mode="security">
<td>
<xsl:choose>
        <xsl:when test="./@securityClassification='01'">
			[级别:01 公开]
		</xsl:when>
        <xsl:when test="./@securityClassification='02'">
			[级别:02 内部]
		</xsl:when>
		<xsl:when test="./@securityClassification='03'">
			[级别:03 秘密]
		</xsl:when>
		<xsl:when test="./@securityClassification='04'">
			[级别:04 机密]
		</xsl:when>
		<xsl:when test="./@securityClassification='05'">
			[级别:05 绝密]
		</xsl:when>
        <xsl:otherwise>
        </xsl:otherwise>
    </xsl:choose>
</td>
</xsl:template>	

<!--密级划分-->
<!--秘级-->
<xsl:template match="*" mode="security1">
<xsl:choose>
        <xsl:when test="./@securityClassification='01'">
			公开
		</xsl:when>
        <xsl:when test="./@securityClassification='02'">
			内部
		</xsl:when>
		<xsl:when test="./@securityClassification='03'">
			秘密
		</xsl:when>
		<xsl:when test="./@securityClassification='04'">
			机密
		</xsl:when>
		<xsl:when test="./@securityClassification='05'">
			绝密
		</xsl:when>
        <xsl:otherwise>
        </xsl:otherwise>
    </xsl:choose>
</xsl:template>
<!--responsiblePartnerCompany-->
<xsl:template match="*" mode="responsiblePartnerCompany">
<td>
	[<xsl:value-of select="@enterpriseCode"/>]
</td>
</xsl:template>
<!--originator-->
<xsl:template match="*" mode="originator">
<td>
	[<xsl:value-of select="@enterpriseCode"/>]
</td>
</xsl:template>
<!--解析主体内容-->
<xsl:template match="content">
	<div id="content">

		<!--参考部分内容-->
		<xsl:if test="refs">
		<xsl:for-each select="refs">
		<p class="titleItalic">{{参考}}</p>
		<a><xsl:attribute name="name"><xsl:value-of select="."/></xsl:attribute></a>
		<table cellspacing="0" class="bordered" id="%TABLEID%">
		<caption class="tableTitle">表 %TABLENO% 参考</caption>
		<colgroup>
			<col/>
			<col/>
		</colgroup>
		<thead>
			<tr>
				<th class="bordered">
					<p class="table">数据模块/技术出版物</p>
				</th>
				<th class="bordered">
					<p class="table">标题</p>
				</th>
			</tr>
		</thead>
		<tbody>
			<tr>
			<td class="bordered">
				<p class="table">
				<xsl:if test="dmRef/dmRefIdent">
				<xsl:for-each select="dmRef/dmRefIdent">
					<a><xsl:attribute name="href">%PATH%<xsl:apply-templates select="dmCode"/>.htm?type=ref</xsl:attribute>
					<xsl:apply-templates select="dmCode"/></a>
				</xsl:for-each>
				</xsl:if>
				</p>
			</td>
			<td class="bordered">
				<p class="table">
					<xsl:value-of select="dmRef/dmRefAddressItems/dmTitle/techName"/> -
					<xsl:value-of select="dmRef/dmRefAddressItems/dmTitle/infoName"/>
				</p>
			</td>
			</tr>
		</tbody>
		</table>
		</xsl:for-each>
		</xsl:if>

		<xsl:for-each select="illustratedPartsCatalog">
			<xsl:for-each select="figure">
				<xsl:apply-templates select="../figure"/>
			</xsl:for-each>
			<xsl:if test="catalogSeqNumber">
				<p class="titleItalic"></p>
				<table cellspacing="0" class="bordered" id="table-media">
				<caption class="tableTitle">表 %TABLENO%</caption>
					<thead>
					  <tr>
					  	<th class="bordered">
						  <p class="table">图号</p>
						</th>
						<th class="bordered">
						  <p class="table">项目号</p>
						</th>
						<th class="bordered">
						  <p class="table">件数</p>
						</th>
						<th class="bordered">
						  <p class="table">供应商代码</p>
						</th>
						<th class="bordered">
						  <p class="table">件号</p>
						</th>
						<th class="bordered">
						  <p class="table">说明</p>
						</th>
						<th class="bordered">
						  <p class="table">型号和适用性</p>
						</th>
						<th class="bordered">
						  <p class="table">交换性</p>
						</th>
					  </tr>
					</thead>
					<tbody>
                        <xsl:variable name="pno" select="substring(catalogSeqNumber/@catalogSeqNumberValue,7,3)"/>
				 	<!-- <tr>
					    <td class="bordered">
						    <p class="table">
						    	<xsl:value-of select="$pno"/>
						    </p>
                        </td>
                        <td class="bordered"/>
                        <td class="bordered"/>
                        <td class="bordered"/>
                        <td class="bordered"/>
                        <td class="bordered"/>
                        <td class="bordered"/>
                        <td class="bordered"/>
                    </tr>  -->
				<xsl:for-each select="catalogSeqNumber">
				    <xsl:variable name="lll" select="position()">	
				    </xsl:variable>
					<!--<xsl:if test="substring(@catalogSeqNumberValue,7,3)!=$pno">
							<tr>
								<td class="bordered">
									<p class="table">
										<xsl:value-of select="substring(@catalogSeqNumberValue,7,3)"/>
									</p>
								</td>
								<td class="bordered"/>
								<td class="bordered"/>
								<td class="bordered"/>
								<td class="bordered"/>
								<td class="bordered"/>
								<td class="bordered"/>
								<td class="bordered"/>
							</tr>
					</xsl:if>-->
                  <xsl:for-each select="itemSequenceNumber">
					<tr>
						<xsl:attribute name="id"><xsl:value-of select="number(normalize-space(../@catalogItemNumber))"/></xsl:attribute>
						<xsl:attribute name="onClick">clickCgm(this)</xsl:attribute>
						<td class="bordered">
						    <xsl:choose>
								<xsl:when test="substring(../@catalogSeqNumberValue,7,3)!=$pno">
									<p class="table">
										<xsl:value-of select="substring(../@catalogSeqNumberValue,7,3)"/>
									</p>
								</xsl:when>
								<xsl:otherwise>
									<xsl:if test="$lll=1">
									<xsl:value-of select="$pno"/>
								</xsl:if>
								</xsl:otherwise>
								
							</xsl:choose>
							
						</td>
						
						<td class="bordered">
						  <xsl:choose>
						  	<xsl:when test="substring(../@catalogSeqNumberValue,10,2)=0">
						      <p class="table"><xsl:value-of select="substring(../@catalogSeqNumberValue,12,2)"/></p>
						    </xsl:when>
						    <xsl:when test="substring(../@catalogSeqNumberValue,10,1)=0">
						      <p class="table"><xsl:value-of select="substring(../@catalogSeqNumberValue,11,3)"/></p>
						    </xsl:when>
						    <xsl:otherwise>
						      <p class="table"><xsl:value-of select="substring(../@catalogSeqNumberValue,10,4)"/></p>
						    </xsl:otherwise>
						  </xsl:choose>
						</td>
						<td class="bordered">
						  <p class="table"><xsl:value-of select="quantityPerNextHigherAssy"/></p>
						</td>
						<td class="bordered">
						  <p class="table"><xsl:value-of select="manufacturerCode"/></p>
						</td>
						<td class="bordered">
						  <p class="table"><xsl:value-of select="partNumber"/></p>
						</td>
						<td class="bordered">
						  <p class="table"><xsl:call-template name="catalogSeqNumber"/><xsl:value-of select="partIdentSegment/descrForPart"/><xsl:value-of select="partSegment/itemIdentData/descrForPart"/></p>
						</td>
						<td class="bordered">
						  <p class="table">
						  	<xsl:if test="applicabilitySegment/usableOnCodeAssy">*<xsl:value-of select="applicabilitySegment/usableOnCodeAssy"/><br/></xsl:if>
						 <!--  	<xsl:if test="applicabilitySegment/usableOnCodeAssy">*<xsl:value-of select="applicabilitySegment/usableOnCodeAssy"/><br/></xsl:if> -->

						  <xsl:if test="locationRcmdSegment/locationRcmd/modelVersion/@modelVersionValue">•<xsl:value-of select="locationRcmdSegment/locationRcmd/modelVersion/@modelVersionValue"/><xsl:if test="locationRcmdSegment/locationRcmd/modelVersion/effectivity">/</xsl:if><xsl:value-of select="locationRcmdSegment/locationRcmd/modelVersion/effectivity"/></xsl:if>
						  <!-- <xsl:if test="locationRcmdSegment/locationRcmd/modelVersion/@modelVersionValue='MB'">•</xsl:if><xsl:value-of select="locationRcmdSegment/locationRcmd/modelVersion/@modelVersionValue"/> -->

						  
						 <!--  <xsl:if test="locationRcmdSegment/locationRcmd/modelVersion/effectivity">/</xsl:if><xsl:value-of select="locationRcmdSegment/locationRcmd/modelVersion/effectivity"/> -->
						  </p>
						</td>
						<td class="bordered">
						  <p class="table"><xsl:value-of select="itemSequenceNumber/applicabilitySegment/interchangeability"/></p>
						</td>
					  </tr>
				</xsl:for-each>
				</xsl:for-each>
				</tbody>
				</table>
			</xsl:if>
		</xsl:for-each>
	</div>
</xsl:template>

    <xsl:template name="catalogSeqNumber">
      <xsl:choose>
      <xsl:when test="../@indenture='1'"></xsl:when>
        <xsl:when test="../@indenture='2'">•</xsl:when>
        <xsl:when test="../@indenture='3'">••</xsl:when>
        <xsl:when test="../@indenture='4'">•••</xsl:when>
        <xsl:when test="../@indenture='5'">••••</xsl:when>
        <xsl:when test="../@indenture='6'">•••••</xsl:when>
        <xsl:when test="../@indenture='7'">••••••</xsl:when>
        <xsl:when test="../@indenture='8'">•••••••</xsl:when>
        <xsl:when test="../@indenture='9'">••••••••</xsl:when>
      </xsl:choose>
    </xsl:template>

</xsl:stylesheet>